package week_home_work02;

import java.util.Scanner;

/**
 * @author zdl
 * @date 2024/11/23
 */
public class Demo75 {
    public static void main(String[] args) {
        //设计一个程序，输出一个数字的反转。
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数字:");
        int num = sc.nextInt();
        int yuanNum = num;
        int fanNum = 0;
        while (num != 0) {
            int lastName = num % 10;
            fanNum = fanNum * 10 + lastName;
            num /= 10;
        }
        System.out.println(yuanNum + "反转后为：" + fanNum);
    }
}
